package com.cxs.observer.spring.impl;

import com.cxs.observer.spring.ObServerSpring;
import com.cxs.observer.spring.WeatherSpring;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

/**
 * @Author: cxs
 */
@Service
public class FaObServerSpringImpl extends ObServerSpring {

    @Lazy
    public FaObServerSpringImpl(WeatherSpring weatherSpring) {
        this.weatherSpring = weatherSpring;
    }

    @Override
    public Object doUpdate() {
        Double temp = this.weatherSpring.getTemp();
        double fa = temp * 1.8 + 32;
        // c * 1.8 +32
        System.out.println("华氏温度为" + fa + "°F");
        return null;
    }
}
